package io.hepu.robotize.base;

import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

@Data
public class EntityRequest<T> implements Serializable {
    private static final long serialVersionUID = 1L;

    private T entity;
    private final List<T> entities = new ArrayList<>();

    public List<T> payload() {
        return entities.isEmpty() ? Collections.singletonList(entity) : entities;
    }
}
